/* $RCSFile: ADNDynImportfile.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/DynEntities/ADNDynImportfile.cs $
 * $log$
 * Revision 19 2010/10/02 14:01:49  christian.surieux
 *   Corrected a bug in allmost everyADNDyn file for PrimaryFieldVualue
 * Revision 6 2010/08/06 19:56:32  christian.surieux
 *   Added Log to All cs files
 */

/* Copyrights Christian Surieux 2010 */
/* Class ADNDynImportfile */
/* Date 2010-01-06 16:07:37Z */

using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using CrmSdk;

namespace AddonNice.CRMWrapper
{
	public class ADNDynImportfile : DynEntity
	{
        protected class Ftor: DFactor
        {
            public Ftor() : base(CrmStr.importfile)
            {}

            public override Type DynType
            { get { return typeof(ADNDynImportfile); } }

            public override string DynTypename
            {   get{ return CrmStr.importfile;}}

            public override DynEntity Build()
            {   return new ADNDynImportfile();}

            public override DynEntity Build(CRMWrapperBase w, InternalDynamicEntity dEntity, PropertyDescriptorCollection wproperties)
            {   return new ADNDynImportfile(w, dEntity, wproperties, null);}

            public override DynEntity Build(CRMWrapperBase w, string PrimaryFieldValue)
            {   return new ADNDynImportfile(w,PrimaryFieldValue);}

            public override DynEntity Build(CRMWrapperBase w,Guid PrimaryKeyValue)
            {   return new ADNDynImportfile(w,PrimaryKeyValue);}
        }

        static ADNDynImportfile(){new Ftor();} 
        
        public override bool HasOwningBusinessUnitProperty
        { get { return true; } }
        
        public ADNDynImportfile() : base() { }
        
        public ADNDynImportfile(CRMWrapperBase w,string PrimaryFieldValue)
            : base(w,CrmStr.importfile)
        {
            if ( PrimaryFieldValue != string.Empty )
                name = PrimaryFieldValue;
        }
        
        public ADNDynImportfile(CRMWrapperBase w,Guid CrmId) : base(w,CrmStr.importfile,CrmId) { }
        
        public ADNDynImportfile(CRMWrapperBase w,InternalDynamicEntity e) : base(w,CrmStr.importfile,e,null,null) { }
        
        public ADNDynImportfile(CRMWrapperBase w,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(w,CrmStr.importfile,e,prop,s) { }
        
        public ADNDynImportfile(ResetWrapperHandler fn,string PrimaryFieldValue)
            : base(fn,CrmStr.importfile)
        {
            if ( PrimaryFieldValue != string.Empty )
                name = PrimaryFieldValue;
        }
        
        public ADNDynImportfile(ResetWrapperHandler fn,Guid CrmId) : base(fn,CrmStr.importfile,CrmId) { }
        
        public ADNDynImportfile(ResetWrapperHandler fn,InternalDynamicEntity e) : base(fn,CrmStr.importfile,e,null,null) { }
        
        public ADNDynImportfile(ResetWrapperHandler fn,InternalDynamicEntity e,PropertyDescriptorCollection prop,InternalColumnSet s) : base(fn,CrmStr.importfile,e,prop,s) { }

        /* Properties */

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid importfileid
        {
            get
            { return KeyPropertyValue(CrmStr.importfileid); }
            set
            { AddKeyProperty(CrmStr.importfileid,value); }
        }

        protected override void SetCrmIdProperty(Guid crmId)
        {
            if ( !dicProperty.ContainsKey(CrmStr.importfileid) || KeyPropertyValue(CrmStr.importfileid) != crmId )
                importfileid = crmId;
        }
        public override Guid PrimaryKeyGuidValue
        {
            get
            { return importfileid; }
            set { importfileid = value; }
        }
        
        public override string PrimaryFieldName
        {
            get
            { return CrmStr.name; }
            set
            {}
        }

        /// <summary>
        /// Value contained in the PrimaryField for the DynEntity or empty if no PrimaryField
        /// </summary>
        public override string PrimaryFieldStringValue
        {
            get
            {
                return name;
            }
            set
            {
                name =   value;
            }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string additionalheaderrow
        {
            get
            { return StringPropertyValue(CrmStr.additionalheaderrow); }
            set
            { AddStringProperty(CrmStr.additionalheaderrow,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string completedon
        {
            get
            { return DateTimePropertyValue(CrmStr.completedon); }
            set
            { AddDateTimeProperty(CrmStr.completedon,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string content
        {
            get
            { return StringPropertyValue(CrmStr.content); }
            set
            { AddStringProperty(CrmStr.content,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int datadelimitercode
        {
            get
            { return PicklistPropertyIntValue(CrmStr.datadelimitercode); }
            set
            { AddPicklistProperty(CrmStr.datadelimitercode,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string datadelimiterLabel
        {
            get
            { return PicklistPropertyLabelValue(CrmStr.datadelimitercode); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public bool enableduplicatedetection
        {
            get
            { return BooleanPropertyValue(CrmStr.enableduplicatedetection); }
            set
            { AddBooleanProperty(CrmStr.enableduplicatedetection,value); }
        }


        [CrmDynAttribute(CrmStr.importfile)]
        public int failurecount
        {
            get
            { return NumberPropertyValue(CrmStr.failurecount); }
            set
            { AddNumberProperty(CrmStr.failurecount,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int fielddelimitercode
        {
            get
            { return PicklistPropertyIntValue(CrmStr.fielddelimitercode); }
            set
            { AddPicklistProperty(CrmStr.fielddelimitercode,value); }
        }

        public string fielddelimiterLabel
        {
            get
            { return PicklistPropertyLabelValue(CrmStr.fielddelimitercode); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string headerrow
        {
            get
            { return StringPropertyValue(CrmStr.headerrow); }
            set
            { AddStringProperty(CrmStr.headerrow,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid importid
        {
            get
            { return LookupPropertyValue(CrmStr.importid); }
            set
            { AddLookupProperty(CrmStr.importid,CrmStr.import,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string importName
        {
            get
            { return LookupPropertyName(CrmStr.importid); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid importmapid
        {
            get
            { return LookupPropertyValue(CrmStr.importmapid); }
            set
            { AddLookupProperty(CrmStr.importmapid,"CrmStr.xxx",value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string importmapidName
        {
            get
            { return LookupPropertyName(CrmStr.importmapid); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public bool isfirstrowheader
        {
            get
            { return BooleanPropertyValue(CrmStr.isfirstrowheader); }
            set
            { AddBooleanProperty(CrmStr.isfirstrowheader,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public override string name
        {
            get
            { return StringPropertyValue(CrmStr.name); }
            set
            { AddStringProperty(CrmStr.name,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid owningbusinessunit
        {
            get
            { return LookupPropertyValue(CrmStr.owningbusinessunit); }
            set
            { AddLookupProperty(CrmStr.owningbusinessunit,CrmStr.businessunit,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid owninguser
        {
            get
            { return LookupPropertyValue(CrmStr.owninguser); }
            set
            { AddLookupProperty(CrmStr.owninguser,CrmStr.systemuser,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string parsedtablecolumnprefix
        {
            get
            { return StringPropertyValue(CrmStr.parsedtablecolumnprefix); }
            set
            { AddStringProperty(CrmStr.parsedtablecolumnprefix,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int parsedtablecolumnsnumber
        {
            get
            { return NumberPropertyValue(CrmStr.parsedtablecolumnsnumber); }
            set
            { AddNumberProperty(CrmStr.parsedtablecolumnsnumber,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string parsedtablename
        {
            get
            { return StringPropertyValue(CrmStr.parsedtablename); }
            set
            { AddStringProperty(CrmStr.parsedtablename,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int processcode
        {
            get
            { return PicklistPropertyIntValue(CrmStr.processcode); }
            set
            { AddPicklistProperty(CrmStr.processcode,value); }
        }

        public string processcodeLabel
        {
            get
            { return PicklistPropertyLabelValue(CrmStr.processcode); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int processingstatus
        {
            get
            { return PicklistPropertyIntValue(CrmStr.processingstatus); }
            set
            { AddPicklistProperty(CrmStr.processingstatus,value); }
        }

        public string processingstatusLabel
        {
            get
            { return PicklistPropertyLabelValue(CrmStr.processingstatus); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int progresscounter
        {
            get
            { return NumberPropertyValue(CrmStr.progresscounter); }
            set
            { AddNumberProperty(CrmStr.progresscounter,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public Guid recordsownerid
        {
            get
            { return LookupPropertyValue(CrmStr.recordsownerid); }
            set
            { AddLookupProperty(CrmStr.recordsownerid,CrmStr.systemuser,value); }
        }

        public string recordsowneridName
        {
            get
            { return LookupPropertyName(CrmStr.recordsownerid); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string size
        {
            get
            { return StringPropertyValue(CrmStr.size); }
            set
            { AddStringProperty(CrmStr.size,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string source
        {
            get
            { return StringPropertyValue(CrmStr.source); }
            set
            { AddStringProperty(CrmStr.source,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string sourceentityname
        {
            get
            { return StringPropertyValue(CrmStr.sourceentityname); }
            set
            { AddStringProperty(CrmStr.sourceentityname,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int successcount
        {
            get
            { return NumberPropertyValue(CrmStr.successcount); }
            set
            { AddNumberProperty(CrmStr.successcount,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public string targetentityname
        {
            get
            { return StringPropertyValue(CrmStr.targetentityname); }
            set
            { AddStringProperty(CrmStr.targetentityname,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int timezoneruleversionnumber
        {
            get
            { return NumberPropertyValue(CrmStr.timezoneruleversionnumber); }
            set
            { AddNumberProperty(CrmStr.timezoneruleversionnumber,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public int totalcount
        {
            get
            { return NumberPropertyValue(CrmStr.totalcount); }
            set
            { AddNumberProperty(CrmStr.totalcount,value); }
        }

        [CrmDynAttribute(CrmStr.importfile)]
        public bool usesystemmap
        {
            get
            { return BooleanPropertyValue(CrmStr.usesystemmap); }
            set
            { AddBooleanProperty(CrmStr.usesystemmap,value); }
        }
    }
}